/**
 * 用户信息
 */
const userInfoModule = {
  namespaced: true,
  state: () => ({ name: '' }),
  getters: {
    userName(state) {
      return state.name;
    },
  },
  mutations: {
    modifyName(state, payload) {
      state.name = payload;
    },
  },
  actions: {
    loadInfo(context) {
      setTimeout(
        () => {
          context.commit('modifyName', '小王');
        },
        1000,
      );
    },
  },
};
export default userInfoModule;
